{% extends 'blog/base.html' %}

{% block title %}Share a Post{% endblock %}

{% block content %}
  <hr>
  {% if sent %}
  <h1 class="text-center">E-MAIL successfully sent.</h1>
  <p class="text-center">"{{ post.title }}" was successfully sent to {{ cd.to }}.<p>
  {% else %}
  <h1 class="text-center">Share "{{ post.title }}" by e-mail.</h1>
  <form action="." method="post" class="form-horizontal">{% csrf_token %}
      <div class="form-group">
           <label class="col-sm-2 control-label">name:</label>
           <div class="col-sm-10">{{ form.name }}</div>
      </div>
      <div class="form-group">
           <label class="col-sm-2 control-label">email:</label>
           <div class="col-sm-10">
               {{ form.email }}
           </div>
      </div>
      <div class="form-group">
           <label class="col-sm-2 control-label">to:</label>
           <div class="col-sm-10">
               {{ form.to }}
           </div>
      </div>
      <div class="form-group">
           <label class="col-sm-2 control-label">comments:</label>
           <div class="col-sm-10">
               {{ form.comments }}
           </div>
      </div>
      <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <input type="submit" value="Send this email" class="btn btn-primary">
          </div>
      </div>
  </form>
  {% endif %}
{% endblock %}
